A first-class function means that functions in JavaScript are treated like any other value. This means:
✅ Functions can be assigned to variables
✅ Functions can be passed as arguments to other functions
✅ Functions can be returned from other functions
✅ Functions can be stored in data structures (like arrays, objects)
✔ Higher-Order Functions – Functions that take other functions as arguments or return functions
✔ Functional Programming – Enables techniques like map, filter, reduce
✔ Callbacks & Event Handling – Used in async operations and event listeners
Would you like more real-world examples of first-class functions? 🚀